﻿<UserControl x:Class="YLServerInterface.UserControls.ImageCutter"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             x:Name="myc"
             d:DesignHeight="640" d:DesignWidth="723" Loaded="UserControl_Loaded" >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--传过来的数据是具有：
    
           Photo :ImageSource
          RectWidth  : double
          RectHeight :double -->

        <Label Grid.Row="0" Name="labTitle" Content="分辨率" Height="28" HorizontalAlignment="Stretch"    Background="#FFA6ABB1" Foreground="White" FontSize="14" HorizontalContentAlignment="Center" />
        <Grid Grid.Row="1">
            <Image Source="{Binding Photo}" Name="img" Stretch="Uniform" SizeChanged="img_SizeChanged"  />
            <Rectangle  Width="{Binding RectWidth}" Height="{Binding RectHeight}"
                MouseDown="rect_MouseDown" StrokeThickness="5" Stroke="Red" Name="rect" Fill="#FF0065FF" OpacityMask="White" Opacity="0.3"  HorizontalAlignment="Left" VerticalAlignment="Top" />
            <Label Content="图片分辨率不符合裁剪要求。" Height="Auto" HorizontalAlignment="Center" Margin="0" Name="labError" VerticalAlignment="Center" FontSize="20" Visibility="Hidden" />
        </Grid>
    </Grid>

</UserControl>

    